package com.infonova.product.jtf.blame.dto;

import org.apache.commons.lang.StringUtils;

public class Call {

    private String clazzName;
    private String methodName;
    private String[] parameterTypes;
    private int level;
    
    public Call(int level, String clazzName, String methodName, String... parameterTypes) {
        this.level = level;
        this.clazzName = clazzName;
        this.methodName = methodName;
        this.parameterTypes = parameterTypes;
    }


    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getClazzName() {
        return clazzName;
    }

    public void setClazzName(String clazzName) {
        this.clazzName = clazzName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String[] getParameterTypes() {
        return parameterTypes;
    }

    public void setParameterTypes(String[] parameterTypes) {
        this.parameterTypes = parameterTypes;
    }


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(StringUtils.leftPad("", level));
        sb.append(clazzName).append(".").append(methodName);
        sb.append("(").append(StringUtils.join(parameterTypes)).append(")");
        return sb.toString();
    }

}